proving points are vertices of right triangle